package com.fintech.common.service;

import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fintech.common.util.PropertiesUtils;
import com.fintech.third.dao.EdcDataQueryLogMapper;
import com.fintech.third.dao.InterfaceCallCountLogMapper;
import com.fintech.third.dao.interfacedata.EdcDataCallOperationRecordsMapper;
import com.fintech.third.dao.interfacedata.EdcProductInterfaceEffecttimeConfigMapper;
import com.fintech.third.dao.log.IntDataQueryBodyMapper;
import com.fintech.third.dao.log.IntDataQueryLogErrorMapper;
import com.fintech.third.dao.log.IntDataQueryLogMapper;
import com.fintech.third.entity.log.InterfaceCallCountInfo;
import com.fintech.third.model.EdcDataQueryLog;
import com.fintech.third.model.ThirdEffectDTO;
import com.fintech.third.model.interfacedata.EdcDataCallOperationRecordsDto;
import com.fintech.third.model.interfacedata.EdcProductInterfaceEffecttimeConfigDto;
import com.fintech.third.model.intlog.IntDataQueryBody;
import com.fintech.third.model.intlog.IntDataQueryLog;
import com.fintech.third.model.intlog.IntDataQueryLogError;
import com.fintech.third.utils.ApplicationContextGet;
import com.fintech.third.utils.ThirdSystemUtil;
import com.marvels.common.utils.MarvelsLogUtil;

import cn.hutool.core.util.StrUtil;

/**
 * 
 * @desc BASE服务基类
 * 
 * @title BaseServiceImpl
 * @author tuxu
 * @date 2018年9月18日
 */
public class BaseServiceImpl {

	@Autowired
	private IntDataQueryLogMapper logMapper;
	@Autowired
	private IntDataQueryBodyMapper logBodyMapper;
	@Autowired
	private IntDataQueryLogErrorMapper errorLogMapper;

	private IntDataQueryLog log;
	private IntDataQueryBody logBody;
	private IntDataQueryLogError errorLog;

	@Autowired
	private EdcDataCallOperationRecordsMapper edcDataCallOperationRecordsMapper;

	@Autowired
	private EdcDataQueryLogMapper edcDataQueryLogMapper;

	@Autowired
	private EdcProductInterfaceEffecttimeConfigMapper edcProductInterfaceEffecttimeConfigMapper;
	/**
	 * 需要重新查询
	 */
	protected static final String QUERY_REALTIME = "0";
	/**
	 * 停止查询（接口停用）
	 */
	protected static final String QUERY_STOP = "1";
	/**
	 * 需要重新查询，并且时效性中间表要记录结果数据
	 */
	protected static final String QUERY_REALTIME_AND_IN_RECORDS = "2";
	/**
	 * 无需重新查询，取历史数据
	 */
	protected static final String QUERY_HISTORY = "3";
	/**
	 * 智盒子查询第三方数据有效时间（天）
	 */
	protected static final int LGDB_EFFECT_TIME = 30;

	/**
	 * 日志
	 * 
	 * @param serialNum
	 * @param code
	 * @param msg
	 * @param reqBody
	 * @param respBody
	 * @param channel
	 * @param method
	 * @param sTime
	 * @param eTime
	 * @param swiftNumber
	 *            百融请求编号
	 */
	public void saveLog(String serialNum, String code, String msg, String reqBody, String respBody, String channel,
			String method, Date sTime, Date eTime, String swiftNumber, String custIdNumber) {
		Date date = new Date();
		MarvelsLogUtil.getInstance().info("set log....");
		log = new IntDataQueryLog();
		log.setSerialNum(serialNum);
		log.setResponseCode(code);
		log.setResponseDetail(msg);
		log.setRequestTime(sTime);
		log.setResponseTime(eTime);
		log.setMethod(method);
		log.setChannel(channel);
		log.setCreatedBy("sys");
		log.setCreatedDate(date);
		log.setSwiftNumber(swiftNumber);
		log.setUpdatedBy("sys");
		log.setCustIdNumber(custIdNumber);
		log.setUpdatedDate(date);
		logBody = new IntDataQueryBody();
		logBody.setSerialNum(serialNum);
		if (StringUtils.isNotEmpty(reqBody)) {
			logBody.setRequestCode(reqBody.getBytes());
		}
		if (StringUtils.isNotEmpty(respBody)) {
			logBody.setResponseBody(respBody.getBytes());
		}
		try {
			if (method.contains("Br") || method.contains("Py") || method.contains("Mx") || method.contains("QX")
					|| method.contains("HQ")) {// 是百融 魔蝎 鹏元的就存数据库
				logMapper.insertSelective(log);
			}
			logBodyMapper.insertSelective(logBody);
		} catch (Exception e) {

			MarvelsLogUtil.getInstance().error("记录日志失败。", e);
		}

	}

	public void saveErrorLog(String serialNum, String code, String msg, String reqBody, String respBody, String channel,
			String method, Date sTime, Date eTime) {
		MarvelsLogUtil.getInstance().info("set error log....");
		errorLog = new IntDataQueryLogError();
		errorLog.setSerialNum(serialNum);
		errorLog.setResponseCode(code);
		errorLog.setResponseDetail(msg);
		errorLog.setRequestTime(sTime);
		errorLog.setResponseTime(eTime);
		errorLog.setMethod(method);
		errorLog.setChannel(channel);

		try {

			errorLogMapper.insertSelective(errorLog);

		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error("记录错误日志失败。", e);
		}

	}

	public void saveCallCountLog(String loanId, String interfaceCode, String result, String thirdProductCode,
			String interfaceDescription) {
		Date date = new Date();
		try {
			InterfaceCallCountLogMapper callCountLogMapper = (InterfaceCallCountLogMapper) ApplicationContextGet
					.getApplicationContext().getBean(InterfaceCallCountLogMapper.class);
			MarvelsLogUtil.getInstance().info("set log....第三方接口调用统计开始");
			InterfaceCallCountInfo interfaceCallCountInfo = new InterfaceCallCountInfo();
			interfaceCallCountInfo.setCreatedDate(date);
			interfaceCallCountInfo.setLoanId(loanId);
			interfaceCallCountInfo.setCreatedBy("sys");
			interfaceCallCountInfo.setInterfaceCode(interfaceCode);
			interfaceCallCountInfo.setResult(result);
			interfaceCallCountInfo.setThirdProductCode(thirdProductCode);
			interfaceCallCountInfo.setUpdatedBy("sys");
			interfaceCallCountInfo.setUpdatedDate(date);
			interfaceCallCountInfo.setInterfaceDescription(interfaceDescription);
			callCountLogMapper.insertCallCountInfo(interfaceCallCountInfo);
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error("记录第三方接口调用统计异常", e);
			return;
		}
		MarvelsLogUtil.getInstance().info("set log....第三方接口调用统计结束");
	}

	/**
	 * 插入第三方数据调用记录
	 * 
	 * @param edcDataCallOperationRecordsDto
	 */
	public void saveEdcDataCallOperationRecords(EdcDataCallOperationRecordsDto edcDataCallOperationRecordsDto) {
		Date date = new Date();
		edcDataCallOperationRecordsDto.setCreatedBy("sys");
		edcDataCallOperationRecordsDto.setCreatedDate(date);
		edcDataCallOperationRecordsDto.setUpdatedBy("sys");
		edcDataCallOperationRecordsDto.setUpdatedDate(date);
		try {
			edcDataCallOperationRecordsMapper.insertEdcDataCallOperationRecords(edcDataCallOperationRecordsDto);
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error("记录第三方数据调用异常", e);
			return;
		}
	}

	/**
	 * 插入时效性中间表
	 * 
	 * @param effectDto
	 */
	public void saveEdcDataCallOperationRecords(ThirdEffectDTO effectDto) {
		EdcDataCallOperationRecordsDto edcDataCallOperationRecords = new EdcDataCallOperationRecordsDto();
		edcDataCallOperationRecords.setCustIdCard(effectDto.getCustIdCard());
		edcDataCallOperationRecords.setInterfaceCode(effectDto.getInterfaceCode());
		edcDataCallOperationRecords.setLoanId(effectDto.getLoanId());
		edcDataCallOperationRecords.setMobile(effectDto.getMobileNo());
		edcDataCallOperationRecords.setProductType(effectDto.getProductType());
		edcDataCallOperationRecords.setValidityEndDate(ThirdSystemUtil.getAddDay(new Date(), effectDto.getEffectTime()));
		saveEdcDataCallOperationRecords(edcDataCallOperationRecords);
	}

	/**
	 * 查询时效性中间表（按接口编码、身份证或者手机号维度区分）<BR>
	 * PS：如果添加产品大类维度，则数据重用性变低，因此取消了产品大类<BR>
	 * 
	 * @param effectDto
	 * @return
	 */
	public EdcDataCallOperationRecordsDto selectEdcDataCallOperationRecordSig(ThirdEffectDTO effectDto) {
		Map<String, Object> conditionMap = new HashMap<String, Object>();
		conditionMap.put("interfaceCode", effectDto.getInterfaceCode());
		conditionMap.put("productType", effectDto.getProductType());
		conditionMap.put("custIdCard", effectDto.getCustIdCard());
		conditionMap.put("mobile", effectDto.getMobileNo());
		return edcDataCallOperationRecordsMapper.selectEdcDataCallOperationRecordSig(conditionMap);
	}

	/**
	 * 获取时间有效性配置信息（按接口编码和产品大类维度区分）
	 * 
	 * @param effectDto
	 * @return
	 */
	public EdcProductInterfaceEffecttimeConfigDto selectEdcProInterfaceTimeConfigSig(ThirdEffectDTO effectDto) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("productType", effectDto.getProductType());
		map.put("interfaceCode", effectDto.getInterfaceCode());
		// 先查询接口的有效期设置 如果未设置则走以前老的接口 如果设置了则判断数据存在与否及数据是否过有效期
		return edcProductInterfaceEffecttimeConfigMapper.selectEdcProInterfaceTimeConfigSig(map);
	}

	/**
	 * 查询智盒子配置的临时时间有效性
	 * 
	 * @return
	 */
	public int getLgdbEffectTime() {
		int effectTime = 0; // 默认为0
		try {
			effectTime = Integer.parseInt(PropertiesUtils.getString("lgdb.effect.time"));
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error("获取时效性参数[lgdb.effect.time]为空，默认为0", e);
		}
		return effectTime;
	}

	/**
	 * 插入第三方数据调用日志（不同第三方不同表）
	 * 
	 * @param reqNo
	 *            请求唯一编码
	 * @param loanId
	 *            贷款编号
	 * @param mobile
	 *            手机号码
	 * @param requestDate
	 *            请求时间
	 * @param interfaceCode
	 *            接口编码
	 * @param responseCode
	 *            第三方返回状态
	 * @param status
	 *            1：查询成功有数据返回 0：查询成功无数据返回 -1：第三方返回的异常状态 -99：落库失败 -9：请求失败
	 * @param tableName
	 *            表名
	 * @param custIdCard
	 *            身份证
	 */
	public void saveDataQueryLogNew(String reqNo, String loanId, String mobile, Date requestDate, String interfaceCode,
			String responseCode, String status, String tableName, String custIdCard) {
		saveDataQueryLogNew(reqNo, loanId, mobile, null, requestDate, interfaceCode, responseCode, status, tableName,
				custIdCard);
	}

	public void deleteDataQueryLogNew(String mobile, String interfaceCode, String tableName) {
		if(StrUtil.hasEmpty(mobile, interfaceCode, tableName)){
			return;
		}
		EdcDataQueryLog log = new EdcDataQueryLog();
		log.setMobile(mobile);
		log.setInterfaceCode(interfaceCode);
		log.setTableName(tableName);
		int i = edcDataQueryLogMapper.deleteByParam(log);
		if(i > 0){
			MarvelsLogUtil.getInstance().info("========deleteDataQueryLogNew:" + JSONObject.toJSONString(log));
		}
	}
	
	/**
	 * 插入第三方数据调用日志（不同第三方不同表）
	 * 
	 * @param reqNo
	 *            请求唯一编码
	 * @param loanId
	 *            贷款编号
	 * @param mobile
	 *            手机号码
	 * @param swiftNumber
	 *            百融查询批次标识
	 * @param requestDate
	 *            请求时间
	 * @param responseDate
	 *            响应时间
	 * @param interfaceCode
	 *            接口编码
	 * @param responseCode
	 *            第三方返回状态
	 * @param status
	 *            1：查询成功有数据返回 0：查询成功无数据返回 -1：第三方返回的异常状态 -99：落库失败 -9：请求失败
	 * @param custIdCard
	 *            身份证
	 */
	public void saveDataQueryLogNew(String reqNo, String loanId, String mobile, String swiftNumber, Date requestDate,
			String interfaceCode, String responseCode, String status, String tableName, String custIdCard) {
		if (StringUtils.isEmpty(reqNo)) {
			reqNo = System.currentTimeMillis() + "_" + RandomStringUtils.randomAlphanumeric(6);
		}
		try {
			Date date = new Date();
			EdcDataQueryLog edcDataQueryLog = new EdcDataQueryLog();
			edcDataQueryLog.setInterfaceCode(interfaceCode);
			edcDataQueryLog.setLoanId(loanId);
			edcDataQueryLog.setMobile(mobile);
			edcDataQueryLog.setCustIdCard(custIdCard);
			edcDataQueryLog.setReqNo(reqNo);
			edcDataQueryLog.setRequestDate(requestDate);
			edcDataQueryLog.setResponseCode(responseCode);
			edcDataQueryLog.setResponseDate(date);
			edcDataQueryLog.setStatus(status);
			edcDataQueryLog.setSwiftNumber(swiftNumber);
			edcDataQueryLog.setCreatedBy("sys");
			edcDataQueryLog.setCreatedDate(date);
			edcDataQueryLog.setUpdatedBy("sys");
			edcDataQueryLog.setUpdatedDate(date);
			edcDataQueryLog.setTableName(tableName);
			MarvelsLogUtil.getInstance().info("=====================edcDataQueryLog:" + edcDataQueryLog);

			edcDataQueryLogMapper.insertSelective(edcDataQueryLog);
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error(">>>>>>>>>>saveDataQueryLogNew exception", e);
		}
	}

	/**
	 * 插入第三方数据调用日志(不同第三方不同表)
	 * 
	 * @param reqNo
	 *            流水唯一批次号
	 * @param loanId
	 *            进件单号
	 * @param mobile
	 *            手机号
	 * @param swiftNumber
	 *            百融查询批次标识
	 * @param requestDate
	 *            请求时间
	 * @param responseDate
	 *            响应时间
	 * @param interfaceCode
	 *            接口代码
	 * @param responseCode
	 *            第三方响应code
	 * @param status
	 *            1：查询成功有数据返回 0：查询成功无数据返回 -1：第三方返回的异常状态 -99：落库失败 -9：请求失败
	 * @param tableName
	 *            表名
	 */
	public void saveDataQueryLog(String reqNo, String loanId, String mobile, String swiftNumber, Date requestDate,
			Date responseDate, String interfaceCode, String responseCode, String status, String tableName,
			String createdBy) {
		if (StringUtils.isEmpty(reqNo)) {
			reqNo = System.currentTimeMillis() + "_" + RandomStringUtils.randomAlphanumeric(6);
		}
		try {
			Date date = new Date();
			EdcDataQueryLog edcDataQueryLog = new EdcDataQueryLog();
			edcDataQueryLog.setCreatedBy(createdBy);
			edcDataQueryLog.setCreatedDate(date);
			edcDataQueryLog.setInterfaceCode(interfaceCode);
			edcDataQueryLog.setLoanId(loanId);
			edcDataQueryLog.setMobile(mobile);
			edcDataQueryLog.setReqNo(reqNo);
			edcDataQueryLog.setRequestDate(requestDate);
			edcDataQueryLog.setResponseCode(responseCode);
			edcDataQueryLog.setResponseDate(date);
			edcDataQueryLog.setStatus(status);
			edcDataQueryLog.setSwiftNumber(swiftNumber);
			edcDataQueryLog.setUpdatedBy(createdBy);
			edcDataQueryLog.setUpdatedDate(date);
			edcDataQueryLog.setTableName(tableName);
			MarvelsLogUtil.getInstance().info("=====================edcDataQueryLog:" + edcDataQueryLog);

			edcDataQueryLogMapper.insertSelective(edcDataQueryLog);
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error(">>>>>>>>>>插入第三方数据调用日志(不同第三方不同表)", e);
		}
	}

	/**
	 * 更新第三方数据调用日志(不同第三方不同表)
	 * 
	 * @param reqNo
	 *            流水唯一批次号
	 * @param loanId
	 *            进件单号
	 * @param mobile
	 *            手机号
	 * @param swiftNumber
	 *            百融查询批次标识
	 * @param requestDate
	 *            请求时间
	 * @param responseDate
	 *            响应时间
	 * @param interfaceCode
	 *            接口代码
	 * @param responseCode
	 *            第三方响应code
	 * @param status
	 *            1：查询成功有数据返回 0：查询成功无数据返回 -1：第三方返回的异常状态 -99：落库失败 -9：请求失败
	 * @param tableName
	 *            表名
	 * @param id
	 */
	public void updateDataQueryLog(String reqNo, String loanId, String mobile, String swiftNumber, Date requestDate,
			Date responseDate, String interfaceCode, String responseCode, String status, String tableName,
			String createdBy, Integer id) {
		EdcDataQueryLog edcDataQueryLog = new EdcDataQueryLog();
		edcDataQueryLog.setId(id);
		edcDataQueryLog.setInterfaceCode(interfaceCode);
		edcDataQueryLog.setLoanId(loanId);
		edcDataQueryLog.setMobile(mobile);
		edcDataQueryLog.setReqNo(reqNo);
		edcDataQueryLog.setRequestDate(requestDate);
		edcDataQueryLog.setResponseCode(responseCode);
		edcDataQueryLog.setResponseDate(responseDate);
		edcDataQueryLog.setStatus(status);
		edcDataQueryLog.setSwiftNumber(swiftNumber);
		edcDataQueryLog.setUpdatedBy(createdBy);
		edcDataQueryLog.setUpdatedDate(new Date());
		edcDataQueryLog.setTableName(tableName);
		MarvelsLogUtil.getInstance().info("=====================edcDataQueryLog:" + edcDataQueryLog);
		try {
			edcDataQueryLogMapper.updateByPrimaryKeySelective(edcDataQueryLog);
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error(">>>>>>>>>>插入第三方数据调用日志(不同第三方不同表)", e);
		}

	}

	/**
	 * 查询第三方数据调用日志(不同第三方不同表)
	 * 
	 * @param reqNo
	 *            流水唯一批次号
	 * @param tableName
	 *            表名
	 */
	public EdcDataQueryLog QueryDataQueryLog(String reqNo, String tableName) {
		EdcDataQueryLog edcDataQueryLog = new EdcDataQueryLog();
		edcDataQueryLog.setReqNo(reqNo);
		edcDataQueryLog.setTableName(tableName);
		MarvelsLogUtil.getInstance().info("=====================reqNo:" + reqNo);
		EdcDataQueryLog selectByReqNo = null;
		try {
			selectByReqNo = edcDataQueryLogMapper.selectByReqNo(edcDataQueryLog);
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error(">>>>>>>>>>插入第三方数据调用日志(不同第三方不同表)", e);
		}
		return selectByReqNo;
	}

	public String getString(JSONObject json, String key) {
		if (json == null) {
			return "";
		}
		String val = StringUtils.trimToNull(json.getString(key));
		if (val == null) {
			return "";
		}
		return val;
	}

	/**
	 * 按字节截取字符串长度
	 * 
	 * @param source
	 *            源字符串
	 * @param len
	 *            长度限制
	 * @return
	 */
	public static String subStr(String source, int len) {
		return subStr(source, "UTF-8", len);
	}

	/**
	 * 按字节截取字符串长度
	 * 
	 * @param source
	 *            源字符串
	 * @param charSet
	 *            字符集编码
	 * @param len
	 *            长度限制
	 * @return
	 * @throws UnsupportedEncodingException
	 */
	public static String subStr(String source, String charSet, int len) {
		if (StringUtils.isEmpty(source)) {
			return "";
		}
		try {
			byte[] byteArr = source.getBytes(charSet); // 字节数组
			int charLen = byteArr.length; // 字符串字节长度

			// 字节长度小于设定值
			if (charLen <= len) {
				return source;
			}
			int count = 0;
			// 统计要截取的那部分字节中负数的个数
			for (int i = 0; i < len; i++) {
				if (byteArr[i] < 0) {
					count++;
				}
			}
			// 负数成对出现 则不会出现半个汉字
			int surplus = count % ("UTF-8".equalsIgnoreCase(charSet) ? 3 : 2);
			return new String(byteArr, 0, len - surplus, charSet);
		} catch (Exception e) {
			MarvelsLogUtil.getInstance().error("截取字符串异常，原样输出。source=" + source, e);
			// 保持原样输出
			return source;
		}
	}

	/**
	 * 第三方数据查询时效性判断公共方法（兼容旧方法）
	 * 
	 * @param loanId
	 *            贷款编号
	 * @param interfaceCode
	 *            接口编码
	 * @return effectFlag：<BR>
	 *         0：未配置时间有效性或者配置时间为0、<BR>
	 *         1：ISUSE为0，接口停用<BR>
	 *         2：正常配置时间有效性，但是在时效性范围内无数据，需重新查询<BR>
	 *         3：时效性范围内有数据，无需重新查询<BR>
	 */
	@Deprecated
	protected ThirdEffectDTO checkEffectInfo(String loanId, String interfaceCode) {
		MarvelsLogUtil.getInstance().info("====BaseServiceImpl.checkEffectInfo loanId:" + loanId + " interfaceCode:" + interfaceCode);
		ThirdEffectDTO effectDto = new ThirdEffectDTO();
		return checkEffectInfo(effectDto);
	}

	/**
	 * 第三方数据查询时效性判断公共方法
	 * 
	 * @param effectDto
	 *            时效性DTO
	 * @return effectFlag：<BR>
	 *         0：未配置时间有效性或者配置时间为0、<BR>
	 *         1：ISUSE为0，接口停用<BR>
	 *         2：正常配置时间有效性，但是在时效性范围内无数据，需重新查询<BR>
	 *         3：时效性范围内有数据，无需重新查询<BR>
	 * @throws Exception
	 */
	protected ThirdEffectDTO checkEffectInfo(ThirdEffectDTO effectDto) {
		MarvelsLogUtil.getInstance().info("=====BaseServiceImpl.checkEffectInfo start effectDto=" + effectDto);
		// 查询时效性配置信息
		EdcProductInterfaceEffecttimeConfigDto configDto = selectEdcProInterfaceTimeConfigSig(effectDto);
		MarvelsLogUtil.getInstance().info("=====configDto:" + JSON.toJSONString(configDto));
		// 未配置时效性，实时查询
		if (configDto == null) {
			effectDto.setEffectFlag(QUERY_REALTIME);
			return effectDto;
		}
		// 停用接口，设置使用字段为0（false），则表示接口不可用
		if (!configDto.getIsUser()) {
			effectDto.setEffectFlag(QUERY_STOP);
			return effectDto;
		}
		// 配置了时效性，但是天数为0，也要实时查询
		if ("0".equals(configDto.getValidityDate())) {
			effectDto.setEffectFlag(QUERY_REALTIME);
			return effectDto;
		}
		// 获取中间表中有效记录数据
		EdcDataCallOperationRecordsDto recordDto = selectEdcDataCallOperationRecordSig(effectDto);
		MarvelsLogUtil.getInstance().info("=====recordDto:" + JSON.toJSONString(recordDto));
		// 时效性范围内无数据，需要重新查询
		if (recordDto == null) {
			effectDto.setEffectFlag(QUERY_REALTIME_AND_IN_RECORDS);
			effectDto.setEffectTime(Integer.parseInt(configDto.getValidityDate()));
			return effectDto;
		}
		// 时效性范围内有数据，无需重新查询
		effectDto.setEffectFlag(QUERY_HISTORY);
		effectDto.setEffectLoanId(recordDto.getLoanId());
		MarvelsLogUtil.getInstance().info("=====BaseServiceImpl.checkEffectInfo end effectDto=" + effectDto);
		return effectDto;
	}
}
